package homework;

import java.io.File;


public class Recursion {
    public static void main(String[] args) {
        File file = new File("files");
        recursion(file);
    }

    public static void recursion(File file){
        if (file.isDirectory()){
            File[] files = file.listFiles();
            if (files == null){
                System.out.println("空目录");
                return;
            }
            for (File f: files ) {
                System.out.println(f.getName());
              recursion(f);
            }
        }

    }

}
